#ifndef __DEV_INFO_CFG_H__
#define __DEV_INFO_CFG_H__
#include <stdint.h>

#define  MAX_PRODUCT_ID_LEN     32
#define  MAX_DEV_ID_LEN         32
#define  MAX_SLAVE_ARRAY_LEN    8
#define  MAX_SUB_DEV_ARRAY_LEN  40


typedef enum
{
    DEVICE_TYPE_METER = 1,          //电表
    DEVICE_TYPE_AIR_CON_GW = 2,     //空调网关
    DEVICE_TYPE_FIRE_CTRL  = 3,     //
    DEVICE_TYPE_DO_CTRL    = 4
}DEVICE_TYPE;

#pragma pack(1)
typedef struct airConSubDevice
{
    uint32_t number;                     //设备编号
    uint8_t subDevID[MAX_DEV_ID_LEN];    //子设备id数组
}AirConSubDevice_t;

typedef struct airConGateInfo  //空调网关信息
{
    uint32_t airConGateAddr;                               //网关地址
    AirConSubDevice_t subDevice[MAX_SUB_DEV_ARRAY_LEN];    //空调子设备数组
}AirConGateInfo_t;

typedef struct meterInfo    //电表信息
{
    uint8_t slaveAddr[MAX_SLAVE_ARRAY_LEN];     //从站地址
}MeterInfo_t;

typedef struct devInfo
{
    uint8_t devType;                                            //设备类型
    uint8_t productID[MAX_PRODUCT_ID_LEN];                      //产品id
    uint8_t devID[MAX_DEV_ID_LEN];                              //设备id
    AirConGateInfo_t gateInfo;                                  //空调网关
    MeterInfo_t    meter;                                       //电表
}DevInfo_t;
#pragma pack()

int GetDevInfoCfg(DevInfo_t *info);
int SetDevInfoCfg(DevInfo_t *info);

#endif